﻿using System;
using System.Data.Objects;
using System.ServiceModel.Activation;
using System.Web;
using System.Web.Routing;

namespace FinMkts.CFD.Rest
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);
            RegisterRoutes();
        }

        private void RegisterRoutes()
        {
            // Edit the base address of CFD by replacing the "CFD" string below
            RouteTable.Routes.Add(new ServiceRoute("CFD", new WebServiceHostFactory(), typeof(CfdService)));
            RouteTable.Routes.Add(new ServiceRoute("Instruments", new WebServiceHostFactory(), typeof(InstrumentService)));
        }
    }
}
